params.wave = [450 550 650];
params.positionDegs =[0 0];
thisSubject = params.thisSubject;
positionDegs = params.positionDegs;
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
idx = find(wave == thisW);
mp(1:4,:) = repmat([0.5 0.5 0.5],[4,1]);
imagesc(support.x,support.y,psf(:,:,idx)/max2(psf(:,:,idx)));
axis image; colormap(mp);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[mn mx]);
% Superimpose the line spread
% Plot the LSF starting from -10 and scaled to -5.
thisLSF = lsf(:,idx)/max(lsf(:,idx));
plot(support.y,5*thisLSF-10,'b-','Linewidth',4);
title(sprintf('W %d Sub %d',thisW,thisSubject));
xlabel('Position (arc min)');
ylabel('Position (arc min)');
plot(support.y,lsf(:,idx),'Linewidth',2);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[0 5e-3]);
end
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
zCoeffDatabase = 'Artal2012';
params.positionDegs =[1 0; 10 0; 20 0];
positionDegs = params.positionDegs(ii,:);
thisSubject = params.thisSubject;
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
idx = find(wave == thisW);
mp(1:4,:) = repmat([0.5 0.5 0.5],[4,1]);
imagesc(support.x,support.y,psf(:,:,idx)/max2(psf(:,:,idx)));
axis image; colormap(mp);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[mn mx]);
thisLSF = lsf(:,idx)/max(lsf(:,idx));
plot(support.y,5*thisLSF-10,'b-','Linewidth',4);
title(sprintf('W %d Sub %d Pos %f',thisW,thisSubject,positionDegs(1)));
xlabel('Position (arc min)');
ylabel('Position (arc min)');
% Superimp[ose the line spread
% plot(support.y,lsf(:,idx),'Linewidth',2);
% tMarks = (-15:5:15); mn = -10; mx = 10;
% set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[0 5e-3]);
zCoeffDatabase = 'Artal2012';
params.thisSubject = [5 15 25];
params.positionDegs =[5 0];
positionDegs = params.positionDegs;
thisSubject = params.thisSubject(ii);
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
idx = find(wave == thisW);
mp(1:4,:) = repmat([0.5 0.5 0.5],[4,1]);
imagesc(support.x,support.y,psf(:,:,idx)/max2(psf(:,:,idx)));
axis image; colormap(mp);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[mn mx]);
thisLSF = lsf(:,idx)/max(lsf(:,idx));
plot(support.y,5*thisLSF-10,'b-','Linewidth',4);
xlabel('Position (arc min)');
ylabel('Position (arc min)');
title(sprintf('W %d Sub %d Pos %f',thisW,thisSubject,positionDegs(1)));
end
Subject 51 from right eye requires central refraction correction
Subject 11 from right eye requires central refraction correction
zCoeffDatabase = 'Artal2012';
subjectRank = 1; % 1:8; % [2, 5, 10, 20];
for thisSubject = subjectRank
lsf = zeros(201,numel(wave),numel(pos));
positionDegs = [pos(ii) 0]; % v
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
lsf(:,:,ii) = psf2lsf(psf);
% Find the luminance weighted sum (luminance)
lumLSF = zeros(201,numel(pos));
vLambda = ieReadSpectra('Vlambda',wave);
lumLSF(:,ii) = lsf(:,:,ii)*vLambda(:);
lumLSF = lumLSF/max(lumLSF(:));
plot(support.y,lumLSF(:,ii),'k-','Linewidth',2);
xlabel('Arc min'); ylabel('Relative luminance')
set(gca,'ylim',[-0.1 1]); set(gca,'xlim',[-5 5]);
set(gca,'xtick',(-5:2.5:5));
legend(sprintf('Subject %d',thisSubject));
print(sprintf('LSF_%s_%d',zCoeffDatabase,thisSubject),'-dpng');
end
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
wavesamples = [400, 450, 500, 550, 600, 650];
leg = cell(numel(wavesamples),1);
for ii=1:numel(wavesamples)
leg{ii} = [num2str(wavesamples(ii)),' nm'];
for ii=1:numel(wavesamples)
idx = find(wave == wavesamples(ii));
plot(support.y,lsf(:,idx),'Linewidth',2);
set(gca,'xlim',[-8 8],'ylim',[0 1]);
xlabel('Arc min'); ylabel('Relative intensity');
lsfs = zeros(201,numel(pos));
tmp = squeeze(lsf(:,idx,ii));
thisLSF = lsf(:,idx,ii)/sum(lsf(:,idx,ii));
surf(pos,support.y,lumLSF);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
title(sprintf('Artal data, Subj rank: %d',subjectRank));
%% Compare at a single wavelength
idx = find(wave == thisWave);
lsfs = zeros(201,numel(pos));
tmp = squeeze(lsf(:,idx,ii));
thisLSF = lsf(:,idx,ii)/sum(lsf(:,idx,ii));
plot(support.x,lsfs(:,ii));
surf(pos,support.y,lsfs);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
title(sprintf('Wave %d',thisWave));
%% Sampled at 0.5 min which is the cone density in the fovea
lsfsInterp = interp2(pos(:),support.y(:),lsfs,possamples,arcmin);
surf(possamples,arcmin,lsfsInterp);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
title(sprintf('Wave %d',thisWave));
surf(possamples',arcmin(:),sInterp);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
xlabel('arc min'); ylabel('relative intensity');
imagesc(support.x, support.y, squeeze(psf(:,:,idx)));
axis 'square'; colormap(gray); xlabel('arc min'); ylabel('arc min');
%% Try putting the zCoeffs for a subject into an oi
scene = sceneCreate('slanted edge', 512, Inf);
scene = sceneSet(scene,'fov',2);
% scene = sceneCrop(scene,[128 160 512 64]);
cmP.positionDegs = [1,0];
cmP.sizeDegs = [0.5 0.3];
cm = cMosaic(cmP);
Starting parallel pool (parpool) using the 'local' profile ...
Connected to the parallel pool (number of workers: 2).
min cone aperture diameter = 2.566750 microns
cm.integrationTime = 0.05;
params.row = 1024; params.col = 1024;
scene = sceneCreate('harmonic',params);
scene = sceneSet(scene,'fov',10);
%% Set up parameters and make the cMosaic
zCoeffDatabase = 'Artal2012';
cmP.positionDegs = [5,0];
cmP.sizeDegs = [10 0.5]; % [0.5 0.3];
fname = fullfile(thisDir,"cm10deg.mat");
%% Loop through some subjects.
for ss = 1:numel(subjectRank)
uData = cell(numel(ecc),1);
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', subjectRank(ss), ...
'eye side', eyeside,'center psf',centerpsf);
% These are the pupilMM and zCoeffs from the top of the file.
% oi = oiCreate('wvf human', pupilMM, zCoeffs, wave);
oi = oiCompute(oi,scene);
[uData{n}, hdl] = cm.plot('excitations horizontal line',allE,...
'plot title',sprintf('Optics ecc %d Rank %d',ii,subjectRank), ...
% cm.plot('excitations',allE);
cc = 1; % Which color channel
sym = {'ko-','kx:','ks-'};
plot(posE{cc}, (tmp)/mx,sym{ii},'LineWidth',2);
legend({num2str(ecc')},'Location','northwest');
% title(sprintf('Subject %d Conetype %d',subjectRank(ss),cc));
xlabel('Position (deg)'); ylabel('Relative excitations');
set(gcf,'Position',[4.0000e-04 0.5486 0.7992 0.3687]);
roiE1 = squeeze(uData{1}.roiE{2});
roiE2 = squeeze(uData{end}.roiE{2});
h = histogram( (roiE1 - roiE2),50);
h.FaceColor = [0.5 0.5 0.5];
grid on; xlabel('\Delta Excitation'); ylabel('N cones');
end
Subject 15 from right eye requires central refraction correction
min cone aperture diameter = 1.716243 microns
Subject 15 from right eye requires central refraction correction